Skip to content

Conversation

@grarco
Copy link
Collaborator

@grarco grarco commented Sep 10, 2025

Describe your changes

Closes #3901 .
Closes #3883.

Reworks the sdk to address the followings:

  • Takes the tx arguments relative to wrapping into an optional separate type (to better control whether a tx should be wrapped or not during the build phase)
  • Improves the dump and dry-run args by making the enum (inner or wrapper)
  • Removes the wrapper signing data from SigningTxData and move it to a new SigningWrapperData which contains all the signing data for a batch
  • Simplified the interface of aux_signing_data
  • The tx builders will now return a separate signing data variant based on wether the tx was wrapped or not
  • Simplified the logic when handling the signatures of a dumped transaction
  • Some new safety checks on operations, like avoiding casting a wrapper tx to a raw one or submitting a non-wrapped transaction
  • Removes some useless dispatcher functions
  • Removes explicit handling of the MASP address as a tx owner. The owner should not be specified in these cases
  • Minor changes to the interface of the build_batch function
  • Removed the owner for reveal_pk (no signature is needed for this transaction)

Checklist before merging

  • If this PR has some consensus breaking changes, I added the corresponding breaking:: labels
    • This will require 2 reviewers to approve the changes
  • If this PR requires changes to the docs or specs, a corresponding PR is opened in the namada-docs repo
    • Relevant PR if applies:
  • If this PR affects services such as namada-indexer or namada-masp-indexer, a corresponding PR is opened in that repo
    • Relevant PR if applies:

@grarco grarco added SDK breaking:SDK SDK breaking change labels Sep 10, 2025
@grarco grarco force-pushed the grarco/wrapper-sigs branch 2 times, most recently from 82edf81 to cbac096 Compare September 15, 2025 12:07
grarco added a commit that referenced this pull request Sep 19, 2025
@grarco grarco force-pushed the grarco/wrapper-sigs branch from 98315b4 to 3e56f75 Compare September 19, 2025 14:27
@grarco grarco marked this pull request as ready for review September 19, 2025 14:28
@grarco grarco requested a review from tzemanovic September 19, 2025 14:34
}
// NOTE: the disposable gas_payer is always overridden by
// signing inputs
} else if disposable_gas_payer {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically if a disposable gas payer is required no signer should be provided since it's not needed, grows the size of the tx (and the gas required) and might leak information. Still, I've maintained the same logic we've had in place for a while for the wrapper signer: if the user specifically passes a signing key we still produce a signature for that (i.e. the user is still in control even though we try to guide them)

@github-actions github-actions bot added the breaking:api public API breaking change label Sep 19, 2025
@mergify
Copy link
Contributor

mergify bot commented Sep 19, 2025

🧪 CI Insights

Here's what we observed from your CI run for 3394fd7.

✅ Passed Jobs With Interesting Signals

Pipeline Job Signal Health on main Retries 🔍 CI Insights 📄 Logs
Lint 🧹 Build 🛠️ Test 🚦 test-e2e (0) Base branch is healthy, but retries were needed. Could be early signs of flakiness 👀 Healthy 1 View View
test-integration Base branch is broken, but the job passed. Looks like this might be a real fix 💪 Broken 0 View View

@@ -0,0 +1,2 @@
- Reworked SDK wrapping and signatures.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we do take this PR I think this should have a bit more details, especially about the breaking changes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the message more specific in 35a691c

use namada_core::voting_power::FractionalVotingPower;
use namada_ethereum_bridge::storage::bridge_pool::get_pending_key;
use namada_io::{Client, Io, display, display_line, edisplay_line};
use namada_token::Amount;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated to this pr but I'm wondering if we should perhaps drop all this eth bridge stuff

.await?;

(SigningData::Inner(signing_data), None)
};
Copy link
Collaborator

@tzemanovic tzemanovic Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look like this new block is the same in many tx types, maybe we can re-use it via some helper fn?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, refactored in 4e33435

@grarco
Copy link
Collaborator Author

grarco commented Sep 24, 2025

@tzemanovic I also fixed a bug for which we were attaching empty auth sections to the transactions (you can see it in de7eda5). That's what was making the e2e tests fail (unless something else comes up in this CI run)

@tzemanovic
Copy link
Collaborator

@tzemanovic I also fixed a bug for which we were attaching empty auth sections to the transactions (you can see it in de7eda5). That's what was making the e2e tests fail (unless something else comes up in this CI run)

thx! I'm just merging #4832 which I think will introduce some conflicts if you don't mind rebasing this after

@grarco
Copy link
Collaborator Author

grarco commented Sep 24, 2025

Yes go ahead, I need to fix some more broken tests in the meantime

grarco added a commit that referenced this pull request Sep 25, 2025
@grarco grarco force-pushed the grarco/wrapper-sigs branch from 35a691c to 685a151 Compare September 25, 2025 13:47
grarco added a commit that referenced this pull request Sep 26, 2025
@grarco grarco force-pushed the grarco/wrapper-sigs branch from 782b04f to a7623af Compare September 26, 2025 13:50
grarco added a commit that referenced this pull request Sep 26, 2025
@grarco grarco force-pushed the grarco/wrapper-sigs branch from a7623af to 12dc976 Compare September 26, 2025 14:14
@grarco
Copy link
Collaborator Author

grarco commented Sep 26, 2025

@tzemanovic I think this is read for a final re-review. Mind that I changed the following:

  • the logic of inner_tx_signer has been reverted to the previous one where the public keys take precedence over the default_signer instead of the two being merged together
  • build_batch has been updated to allow batching txs that are already batch (it was previously limited to a single inner transaction)

@grarco grarco requested a review from tzemanovic September 26, 2025 15:25
@grarco grarco force-pushed the grarco/wrapper-sigs branch from ec0d850 to 73c9efd Compare September 30, 2025 09:38
@tzemanovic
Copy link
Collaborator

I've just added a tiny commit to fix the CI changelog check

@tzemanovic tzemanovic added backport-libs-0.251 Backport libraries to 0.251 maintenance branch backport-201.0 Backport to app 201.0 maintenance branch merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass labels Oct 1, 2025
@mergify mergify bot added the queued label Oct 1, 2025
@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

mergify bot added a commit that referenced this pull request Oct 1, 2025
mergify bot added a commit that referenced this pull request Oct 1, 2025
mergify bot added a commit that referenced this pull request Oct 1, 2025
mergify bot added a commit that referenced this pull request Oct 1, 2025
@mergify mergify bot merged commit b3b8e63 into main Oct 1, 2025
45 of 46 checks passed
@mergify mergify bot deleted the grarco/wrapper-sigs branch October 1, 2025 17:08
@mergify mergify bot removed the queued label Oct 1, 2025
mergify bot pushed a commit that referenced this pull request Oct 1, 2025
(cherry picked from commit 73c9efd)
mergify bot pushed a commit that referenced this pull request Oct 1, 2025
(cherry picked from commit 73c9efd)
mergify bot added a commit that referenced this pull request Oct 1, 2025
@tzemanovic tzemanovic mentioned this pull request Oct 8, 2025
3 tasks
tzemanovic pushed a commit that referenced this pull request Oct 8, 2025
(cherry picked from commit 73c9efd)
mergify bot added a commit that referenced this pull request Oct 8, 2025
…pr-4816

Refactor SDK args and sigs (backport #4816)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-201.0 Backport to app 201.0 maintenance branch backport-libs-0.251 Backport libraries to 0.251 maintenance branch breaking:api public API breaking change breaking:SDK SDK breaking change merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rework wrapper signature workflow Improve batching API

3 participants